#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <queue>
#include <algorithm>

#define FOR(i,a,n) for(int i=a;i<n;++i)
#define REP(i,n) FOR(i,0,n)

using namespace std;

class BinaryIndexedTree
{
public:
    int *a;
    int length;
    BinaryIndexedTree(int n=20000)
    {
        a = new int[(length=n)+10];
        fill(a,a+length+10,0);
    }
    ~BinaryIndexedTree(){delete(a);}
    inline int LowBit(int pos){return pos&(-pos);}
    void Insert(int pos,int val)
    {
        while(pos<=length)
        {
            a[pos]+=val;
            pos += LowBit(pos);
        }
    }
    int Query(int lb,int rb)
    {
        if(lb!=1) return Query(1,rb)-Query(1,lb-1);
        else
        {
            int ans = 0;
            while(rb>0)
                ans+=a[rb],rb-=LowBit(rb);
            return ans;
        }
    }
};

typedef pair<int,int> pii;
#define x first
#define y second
pii star[20000],*ps[20000];
int n;
bool cmp(pii* pa,pii* pb){return pa->x<pb->x;};

int main()
{
    while(cin>>n)
    {
        REP(i,n) scanf("%d%d",&star[i].x,&star[i].y),ps[i]=star+i;
       // sort(ps,ps+n,cmp);
        //int p=1;
       // REP(i,n-1) ps[i]->x=(ps[i]->x==ps[i+1]->x?p:p++);
       // ps[n-1]->x=p;
        vector<int> cnt(n+1,0);
        BinaryIndexedTree bitTree(32000+1);
        REP(i,n)
        {
            int t = bitTree.Query(1,star[i].x+1);
            cnt[t]++;
            bitTree.Insert(star[i].x+1,1);
        }
        REP(i,n) printf("%d\n",cnt[i]);
    }
	return 0;
}
